#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 6005;
const int MOD = 1e9 + 7;
int n, l, k;
int f[N];
int dp[N];
int d[N << 1];
void init() {
  f[1] = 1;
  rep(i, 2, 6000) {
    ll x = MOD / i;
    ll y = MOD % i;
    f[i] = (-1ll * x * f[y] % MOD + MOD) % MOD;
  }
}
void solve(int r) {
  if (r == 1) {
    rep(i, 1, n) dp[i] = 0;
    rep(i, 1, 1 + k) {
      int j = (i - 1) % n + 1;
      dp[j] = (dp[j] + f[1 + k]) % MOD;
    }
    return;
  }
  solve(r - 1);
  rep(i, 1, n + r + k + 1) d[i] = 0;
  d[1] = 1, d[r + k + 1] = MOD - 1;
  rep(i, 2, n + 1) {
    d[i] = (d[i] + dp[i - 1]) % MOD;
    d[i + r + k] = (d[i + r + k] - dp[i - 1] + MOD) % MOD;
  }
  rep(i, 1, n) dp[i] = 0;
  rep(i, 1, n + r + k) {
    d[i] = (d[i - 1] + d[i]) % MOD;
    int j = (i - 1) % n + 1;
    dp[j] = (dp[j] + d[i]) % MOD;
  }
  rep(i, 1, n) dp[i] = 1ll * dp[i] * f[r] % MOD;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  init();
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> l >> k;
    solve(l);
    rep(i, 1, n) cout << dp[i] << ' ';
    cout << endl;
  }
  return 0;
}